Integrate large language models into your application through a
common interface for supported providers and models. The application
chooses the provider, model and other session settings. The class
manages connections and conversation history while interacting with
the model. Both cloud-based and locally hosted models are supported.
Reference
Library Information
| Class Name |
CLlmClient |
| File Name |
CSLLMV12.DLL |
| Version |
12.0.3041.1380 |
| LibID |
E77A6A0A-3B86-49D9-9A3D-A0B425BDA66D |
| Import Library |
CSLLMV12.LIB |
| Dependencies |
None |
Overview
The CLlmClient class is designed around a session-based architecture that
encapsulates all aspects of interacting with a language model,
including connection details, configuration settings, and conversation
history. This design allows developers to treat each interaction as
part of a managed context, making it easier to maintain state across
multiple requests without needing to manually track prior messages or
model parameters. Sessions can be configured with defaults or
customized with options such as system prompts, token limits, and
behavioral settings, depending on the needs of the application.
A central goal of the class is to abstract the differences between
providers and models, presenting a unified interface that works
consistently regardless of the underlying service. Developers can
discover available providers and models, query their capabilities, and
select appropriate configurations at runtime. This flexibility makes
it possible to switch between services or adapt to new models with
minimal code changes, while still exposing enough detail to fine-tune
behavior when needed.
The class also provides robust support for managing conversation
data. It maintains a structured history of messages and responses,
enabling applications to iterate through prior interactions, search
for specific content, or limit the amount of retained context to
control memory usage and token consumption. This is particularly
important when working with models that have strict context limits, as
it allows developers to balance response quality with performance and
cost considerations.
In addition to core messaging functionality, the API includes a
range of utility features that help developers monitor and optimize
their applications. These include estimating and tracking token usage,
managing cache lifetimes for model metadata, handling errors in a
consistent way, and optionally logging network activity for debugging
purposes. Together, these capabilities provide insight into how the
application is interacting with the model and help identify potential
performance or configuration issues.
Overall, the class is designed to provide a practical balance
between simplicity and control. It enables developers to quickly add
AI-powered features to their applications while retaining the
flexibility to customize behavior, manage resources, and integrate
with different providers as requirements evolve.
Requirements
The SocketTools Library Edition is compatible with any
programming language that can call functions exported from a
standard Windows DLL. If you are using Visual Studio, the
minimum supported version is Visual Studio 2010 with Service
Pack 1 (SP1). The header files are compatible with modern
C/C++ compilers, and function declarations are provided for
several other languages. We recommend installing the latest
updates for your development tools and the Windows SDK.
SocketTools supports Windows 7 SP1, Windows Server 2008 R2 SP1,
and later desktop and server versions of Windows, with Windows 8.1
as the minimum supported version for Windows 8-based systems.
Both 32-bit and 64-bit Windows platforms are supported for
application development. Windows on ARM requires Windows 10
build 1709 or later. We recommend using a version of Windows
that is currently supported by Microsoft for application
development.
SocketTools provides 32-bit x86, 64-bit x64, and native ARM64
libraries. The x86 libraries maintain compatibility with legacy
development tools and can run under emulation on Windows on ARM.
Native ARM32 applications are not supported because Microsoft
discontinued support for 32-bit ARM applications in Windows.
For native ARM64 development, we recommend Visual Studio 2019 or
later. Some development tools, including recent versions of
Embarcadero Delphi, support Windows on ARM using the ARM64EC
architecture. ARM64EC applications can use x64 DLLs through emulation,
but cannot load native ARM64 DLLs. Developers targeting ARM64EC
should use the SocketTools x64 libraries rather than the native
ARM64 libraries.
Import libraries are provided in COFF format for x86, x64, and
ARM64 platforms. OMF libraries are also provided for x86, and ELF
libraries for x64, to support older Borland and Embarcadero
compilers. Visual Studio developers should use the standard COFF
libraries. Some programming languages can call exported DLL
functions directly without requiring an import library.
Distribution
When distributing an application that uses this library, we
recommend installing the SocketTools DLL in the same folder as
the application executable. This simplifies deployment and
avoids potential conflicts with other applications that use
different versions of the library. The DLL must be compatible
with the application's processor architecture (x86, x64, or
ARM64). If the library is installed in a shared system location,
the installer should manage it as a shared DLL to prevent other
applications from being affected when it is updated or removed.
SocketTools libraries are standard Windows DLLs, not ActiveX
components, and do not require COM registration.
This library has no external runtime dependencies beyond the
standard Windows system libraries. It does not require the
Microsoft Visual C++ Redistributable or any additional third-party
libraries to be installed. All required components are either
provided by Windows or statically linked into the SocketTools DLLs,
simplifying deployment and eliminating the need to distribute
additional runtime files.
|